import {service} from "@/utils/http";
import {blog} from "@/store/modules/blog";

/* 查询浏览数、收藏数、点赞数 */
export const blogStatistics = (userId) => {
    const url = `blogCenter/statistics/allStatistics?userId=` + userId;
    return service.get(url, userId)
}

/* 统计用户的博客数 */
export const countBlogNumber = (userId) => {
    const url = `blogCenter/statistics/countBlogNumber?userId=` + userId;
    return service.get(url, userId)
}

/* 用于图表展示 */
export const countForChart = () => {
    const url = `blogCenter/statistics/countForChart`
    return service.get(url)
}

/* 统计用户博客被访问数 */
export const countPageViewForChart = (userId) => {
    const url = `blogCenter/statistics/countPageViewForChart?userId=` + userId
    return service.get(url, userId)
}

/* 获取单篇博客的统计信息 */
export const getOneBlogStatistics = (blogId) => {
    const url = `blogCenter/statistics/getOneBlogStatistics?blogId=` + blogId
    return service.get(url, blogId)
}

/* 博客归档 */
export const countBlogArchive = (userId) => {
    const url = `blogCenter/statistics/countBlogArchive?userId=` + userId
    return service.get(url, userId)
}

/* 统计收藏夹里面对应的博客数 */
export const countBlogNumberInFavorites = (favoriteId) => {
    const url = `blogCenter/statistics/countBlogNumberInFavorites?favoriteId=` + favoriteId
    return service.get(url, favoriteId)
}
/* 统计文章管理处的单篇博客需要的数据 */
export const countForOneBlog = (blogId) => {
    const url = `blogCenter/statistics/countForOneBlog?blogId=` + blogId
    return service.get(url, blogId)
}

/* 统计博客文章管理里面那些总体数据 */
export const countForBlogManage = (userId) => {
    const url = `blogCenter/statistics/countForBlogManage?userId=` + userId
    return service.get(url, userId)
}